Skip to content

Conversation

Saeris
Copy link

@Saeris Saeris commented Apr 3, 2020

Added jsdom as a dependency.

In parser-markup.js, document is accessed to create a frame to render HTML in. Since document doesn't exist in Node, this causes SSR builds to throw a reference error. With this change, we check for the existence of document and polyfill it using jsdom if it doesn't exist.

Added `jsdom` as a dependency.

In parser-markup.js, `document` is accessed to create a frame to render HTML in. Since `document` doesn't exist in Node, this causes SSR builds to throw a reference error. With this change, we check for the existence of `document` and polyfill it using `jsdom` if it doesn't exist.
@developit
Copy link
Owner

This is going to inline jsdom in all bundlers.

I think we'll need to provide a separate entry module for web/node in order to do the polyfilling.

@danielweck
Copy link

There are several PR proposals (plus one that was closed without resolution), so I wrote a quick heads-up: #6 (comment)
(Preact WMR uses JSDOM in its Mardown render code)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants